package creatType.AbstractFactory;

import creatType.AbstractFactory.animal.IChicken;
import creatType.AbstractFactory.animal.IDuck;
import creatType.AbstractFactory.factory.IAbstractFactory;
import creatType.AbstractFactory.factory.impl.FlyAbstractFactoryImpl;
import creatType.AbstractFactory.factory.impl.RunAbstractFactoryImpl;

public class Main {
    public static void main(String[] args) {
        // 创建fly的工厂
        IAbstractFactory iAbstractFactory = new FlyAbstractFactoryImpl();

        IChicken iChicken = iAbstractFactory.createChicken();
        IDuck iDuck = iAbstractFactory.createDuck();

        iChicken.show();
        iDuck.show();

        System.out.println("------------------------------");
        // 创建run的工厂
        iAbstractFactory = new RunAbstractFactoryImpl();

        iChicken = iAbstractFactory.createChicken();
        iDuck = iAbstractFactory.createDuck();

        iChicken.show();
        iDuck.show();
    }
}